package com.ram.service.impl;

import com.ram.mapper.AssetAssignmentMapper;
import com.ram.pojo.AssetAssignment;
import com.ram.service.AssetAssignmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;

@Service
public class AssetAssignmentServiceImpl implements AssetAssignmentService {
    @Autowired
    private AssetAssignmentMapper assignmentMapper;

    @Override
    public List<AssetAssignment> list() {
        return assignmentMapper.list();
    }

    @Override
    public AssetAssignment getById(Integer id) {
        return assignmentMapper.getById(id);
    }

    @Override
    public void add(AssetAssignment assignment) {
        assignment.setCreateTime(LocalDateTime.now());
        assignmentMapper.insert(assignment);
    }

    @Override
    public void update(AssetAssignment assignment) {
        assignmentMapper.update(assignment);
    }

    @Override
    public void deleteById(Integer id) {
        assignmentMapper.deleteById(id);
    }
} 